package sspersonserver.db;

import sspersonserver.LoginData;
import sspersonserver.subjects.*;

import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: Double
 * Date: 25.01.12
 * Time: 16:49
 * To change this template use File | Settings | File Templates.
 */
public class MockDB implements IDB
{
	private ArrayList<FullPerson> persons = new ArrayList<FullPerson>();

	@Override
	public ArrayList<Person> getPersonList()
	{
		ArrayList<Person> p = null;
		return p;
	}

	@Override
	public ArrayList<Person> getPersonList(int startIndex, int endIndex)
	{
		ArrayList<FullPerson> qPersons = new ArrayList<FullPerson>();
		for(int i=startIndex;i<endIndex;i++)
		{
			qPersons.add(persons.get(i));
		}
		return (ArrayList<Person>) qPersons.clone();
	}

	@Override
	public ArrayList<Country> getCountry()
	{
		return null;  //To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public ArrayList<City> getCity(int i)
	{
		return null;  //To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public ArrayList<Street> getStreet(int i)
	{
		return null;  //To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public ArrayList<Address> getAddress()
	{
		return null;  //To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void addCountry(Country country)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void addCity(City city)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void addStreet(Street street)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void removeCountry(Country country)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void removeCity(City city)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void removeStreet(Street street)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public FullPerson getFullPerson(int id)
	{
		return null;  //To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void saveFullPerson(FullPerson fullPerson)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void save(ArrayList<Person> persons)
	{
	/*	for(FullPerson p:persons)
		{
			this.persons.add(p);	
		} */
	}

	@Override
	public void update(FullPerson fullPerson)
	{
		for(FullPerson p:persons)
		{
			for(FullPerson p1:this.persons)
			{
				/*if(p1.getID()==p.getID())
				{
					this.persons.set(this.persons.indexOf(p1),p);
					break;
				} */
			}
		}
	}

	@Override
	public void delete(FullPerson fullPerson)
	{
		/*for(Person p:persons)
		{
			for(FullPerson p1:this.persons)
			{
				if(p1.getP().getID()==p.getID())
				{
					this.persons.remove(this.persons.indexOf(p1));
					break;
				}
			}
		} */

	}

	@Override
	public int checkAuth(LoginData loginData)
	{
		return 0;  //To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void connect(String ip, String database)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void disconnect()
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public ArrayList<PhoneType> getPhoneType()
	{
		return null;  //To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void addPhoneType(PhoneType phoneType)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}

	@Override
	public void removePhoneType(PhoneType phoneType)
	{
		//To change body of implemented methods use File | Settings | File Templates.
	}
}
